package com.compty.paint.domain;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * @Todo:一级分类(国画、油画、器具)
 * @author: zhuqh
 * @CreateTime:2011-06-03 下午05:27:16
 */
@Entity
@Table(name = "t_catalogtype")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class CatalogType implements java.io.Serializable{
	
	private static final long serialVersionUID = 4925470758491877504L;

	private Long id;
	
	private String name;
	
	/************英文名称  ****************/
	private String english_name;
	
	private Integer orderSequence;
	
	/************ 二级分类  ****************/
	private List<PaintType> subTypes = new ArrayList<PaintType>(0);

	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name="name",length=40)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "catalogType")
	public List<PaintType> getSubTypes() {
		return subTypes;
	}

	public void setSubTypes(List<PaintType> subTypes) {
		this.subTypes = subTypes;
	}

	@Column(name="order_sequence")
	public Integer getOrderSequence() {
		return orderSequence;
	}

	public void setOrderSequence(Integer orderSequence) {
		this.orderSequence = orderSequence;
	}

	@Column(name="english_name",nullable=false,length=40)
	public String getEnglish_name() {
		return english_name;
	}

	public void setEnglish_name(String englishName) {
		english_name = englishName;
	}
}
